
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>K8s部署 · MLSQL Engine 文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/image.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="yarn_deploy.html" />
    
    
    <link rel="prev" href="deploy.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    MLSQL Engine产品简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    MLSQL Engine基本安装
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="configuration.html">
            
                <a href="configuration.html">
            
                    
                    启动参数详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="deploy.html">
            
                <a href="deploy.html">
            
                    
                    Local
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.3" data-path="k8s_deploy.html">
            
                <a href="k8s_deploy.html">
            
                    
                    K8s部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="yarn_deploy.html">
            
                <a href="yarn_deploy.html">
            
                    
                    Yarn部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../security/README.md">
            
                <span>
            
                    
                    MLSQL Engine安全加固
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../security/token_control.html">
            
                <a href="../security/token_control.html">
            
                    
                    接口访问Token设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../security/custom_control.html">
            
                <a href="../security/custom_control.html">
            
                    
                    自定义接口访问策略
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../auth/">
            
                <a href="../auth/">
            
                    
                    MLSQL Engine数据访问控制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" >
            
                <span>
            
                    
                    解析时表权限
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" >
            
                <span>
            
                    
                    运行时表权限表以及列权限
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" >
            
                <span>
            
                    
                    客户端开发
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" >
            
                <span>
            
                    
                    服务端开发
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../api/README.md">
            
                <span>
            
                    
                    MLSQL Engine Rest接口详解
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../api/run-script.html">
            
                <a href="../api/run-script.html">
            
                    
                    /run/script
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../python/">
            
                <a href="../python/">
            
                    
                    MLSQL Python支持
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../python/env.html">
            
                <a href="../python/env.html">
            
                    
                    环境依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../python/etl.html">
            
                <a href="../python/etl.html">
            
                    
                    数据处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../python/train.html">
            
                <a href="../python/train.html">
            
                    
                    模型训练
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../python/pyjava.html">
            
                <a href="../python/pyjava.html">
            
                    
                    PyJava API简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../python/read_excel.html">
            
                <a href="../python/read_excel.html">
            
                    
                    结合Python读取Excel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../python/write_excel.html">
            
                <a href="../python/write_excel.html">
            
                    
                    结合Python保存Excel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../python/resource.html">
            
                <a href="../python/resource.html">
            
                    
                    K8s下的Python资源限制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../python/datamode.html">
            
                <a href="../python/datamode.html">
            
                    
                    dataMode 详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../python/py_paralell.html">
            
                <a href="../python/py_paralell.html">
            
                    
                    Python并行度你所需要知道的
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../plugin/">
            
                <a href="../plugin/">
            
                    
                    插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../plugin/online_install.html">
            
                <a href="../plugin/online_install.html">
            
                    
                    网络安装插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../plugin/offline_install.html">
            
                <a href="../plugin/offline_install.html">
            
                    
                    离线安装插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >K8s部署</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="k8s&#x90E8;&#x7F72;">K8S&#x90E8;&#x7F72;</h1>
<blockquote>
<p>&#x76EE;&#x524D;&#x5B9E;&#x6D4B;Spark 3.0 &#x901A;&#x8FC7;&#x3002;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;3.0 &#x8FDB;&#x884C;K8s&#x90E8;&#x7F72;&#x3002;</p>
</blockquote>
<p>&#x76EE;&#x524D;K8s&#x90E8;&#x7F72;&#x6709;&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#xFF1A;</p>
<ol>
<li>Spark&#x5B98;&#x65B9;&#x7684; <a href="http://spark.apache.org/docs/latest/running-on-kubernetes.html" target="_blank">spark-submit&#x65B9;&#x5F0F;</a></li>
<li>Google &#x5F00;&#x53D1;&#x7684;<a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator" target="_blank">Operater&#x65B9;&#x5F0F;</a></li>
</ol>
<p>&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#x7684;&#x5DEE;&#x522B;&#x662F;&#xFF0C;Google&#x662F;&#x88F8;&#x9732;K8s&#x7684;&#x547D;&#x4EE4;&#x6765;&#x8FDB;&#x884C;&#x90E8;&#x7F72;&#x7684;&#xFF0C;&#x800C;Spark&#x5B98;&#x65B9;&#x5219;&#x662F;&#x901A;&#x8FC7;Spark-Submit&#x900F;&#x660E;&#x5B8C;&#x6210;K8s&#x90E8;&#x7F72;&#x7684;&#x3002;&#x53E6;&#x5916;&#xFF0C;Google&#x7684;&#x76EE;&#x524D;&#x6BD4;&#x8F83;&#x9002;&#x5408;&#x4F5C;&#x4E3A;&#x4E00;&#x6B21;&#x6027;&#x4EFB;&#x52A1;&#x63D0;&#x4EA4;&#xFF0C;Spark&#x5B98;&#x65B9;&#x7684;&#x66F4;&#x9002;&#x5408;&#x5C06;Spark&#x90E8;&#x7F72;&#x6210;&#x670D;&#x52A1;&#x3002;&#x800C;MLSQL Engine&#x4E3B;&#x8981;&#x4EE5;Service&#x65B9;&#x5F0F;&#x90E8;&#x7F72;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x63A8;&#x8350;&#x5B98;&#x65B9;&#x7684;&#x90E8;&#x7F72;&#x6A21;&#x5F0F;&#x3002;</p>
<p>&#x5728;K8s&#x90E8;&#x7F72;MLSQL Engine&#x7684;&#x57FA;&#x672C;&#x601D;&#x8DEF;&#x662F;,&#x5C06;spark-submit&#x547D;&#x4EE4;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;K8s Pod&#x7684;&#x542F;&#x52A8;&#x547D;&#x4EE4;&#xFF0C;&#x5C31;&#x50CF;&#x6211;&#x4EEC;&#x5E73;&#x65F6;&#x542F;&#x52A8;&#x4E00;&#x4E2A;web&#x670D;&#x52A1;&#x4E00;&#x6837;&#x3002;&#x542F;&#x52A8;&#x5B8C;&#x6210;&#x540E;&#xFF0C;spark-submit&#x4F1A;&#x81EA;&#x52A8;&#x5411;K8s &#x7533;&#x8BF7;executor Pods.</p>
<p>&#x5982;&#x679C;&#x662F;&#x624B;&#x5DE5;&#x64CD;&#x4F5C;&#xFF0C;&#x5C31;&#x662F;&#x542F;&#x52A8;&#x4E00;&#x4E2A;pod,&#x7136;&#x540E;&#x5728;&#x91CC;&#x9762;&#x8FD0;&#x884C;spark-submit&#x547D;&#x4EE4;&#xFF0C;spark-submit&#x4F1A;&#x5B8C;&#x6210;&#x5982;&#x4E0B;&#x4E24;&#x4EF6;&#x4E8B;&#xFF1A;</p>
<ol>
<li>&#x542F;&#x52A8;9003&#x7AEF;&#x53E3;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;MLSQL Engine&#x7684;HTTP&#x7AEF;&#x53E3;,&#x5916;&#x90E8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8BE5;&#x7AEF;&#x53E3;&#x8BBF;&#x95EE;&#x3002;</li>
<li>&#x5411;K8s&#x7533;&#x8BF7; Executor Pods</li>
</ol>
<p>&#x6700;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x7B2C;&#x4E00;&#x4E2A;Pod&#x589E;&#x52A0;service&#x4EE5;&#x53CA;ingress&#x914D;&#x7F6E;&#x540E;&#x5C31;&#x53EF;&#x4EE5;&#x5BF9;&#x5916;&#x63D0;&#x4F9B;&#x670D;&#x52A1;&#x4E86;&#x3002;</p>
<h2 id="&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x793A;&#x4F8B;">&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x793A;&#x4F8B;</h2>
<p>&#x4E0B;&#x9762;&#x662F;Deployment &#x7684;template:</p>
<pre><code class="lang-yaml"><span class="hljs-attr"> template:</span>
<span class="hljs-attr">    metadata:</span>
<span class="hljs-attr">      labels:</span>
<span class="hljs-attr">        app:</span> spark-mlsql<span class="hljs-bullet">-3</span>
<span class="hljs-attr">    spec:</span>
<span class="hljs-attr">      containers:</span>
<span class="hljs-attr">      - name:</span> spark-mlsql<span class="hljs-bullet">-3</span>
<span class="hljs-attr">        args:</span>
<span class="hljs-bullet">          -</span> &gt;-
            echo <span class="hljs-string">&quot;/opt/spark/bin/spark-submit --master k8s://https://xxx.xxx.xxx.xxx:xxxx 
            --deploy-mode client 
            --jars local:///tmp/streamingpro-mlsql-spark_3.0_2.12-1.7.0-SNAPSHOT.jar 
            --class streaming.core.StreamingApp 
            --conf spark.kubernetes.container.image=xxxxx/dev/spark-jdk-slim-14:v3.0.0 
            --conf spark.kubernetes.container.image.pullPolicy=Always 
            --conf spark.kubernetes.namespace=dev 
            --conf spark.kubernetes.authenticate.driver.serviceAccountName=xxxxx 
            --conf spark.kubernetes.container.image.pullSecrets=xxxxx 
            --conf spark.kubernetes.driver.request.cores=1 
            --conf spark.kubernetes.driver.limit.cores=1 
            --conf spark.kubernetes.executor.request.cores=1 
            --conf spark.kubernetes.executor.limit.cores=1 
            --conf spark.executor.instances=1 
            --conf spark.driver.host=$POD_IP 
            --conf spark.sql.cbo.enabled=true 
            --conf spark.sql.adaptive.enabled=true 
            --conf spark.sql.cbo.joinReorder.enabled=true 
            --conf spark.sql.cbo.planStats.enabled=true 
            --conf spark.sql.cbo.starSchemaDetection=true 
            --conf spark.driver.maxResultSize=2g 
            --conf spark.serializer=org.apache.spark.serializer.KryoSerializer 
            --conf spark.kryoserializer.buffer.max=200m 
            --conf &quot;</span>\<span class="hljs-string">&quot;spark.executor.extraJavaOptions=-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+UseContainerSupport  -Dio.netty.tryReflectionSetAccessible=true\&quot;&quot;</span>  
<span class="hljs-bullet">            -</span>-conf <span class="hljs-string">&quot;\&quot;spark.driver.extraJavaOptions=-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+UseContainerSupport  -Dio.netty.tryReflectionSetAccessible=true\&quot;&quot;</span> 
<span class="hljs-attr">            local:</span>///tmp/streamingpro-mlsql-spark_3<span class="hljs-number">.0</span>_2<span class="hljs-number">.12</span><span class="hljs-bullet">-1.7</span><span class="hljs-number">.0</span>-SNAPSHOT.jar 
<span class="hljs-bullet">            -</span>streaming.name spark-mlsql<span class="hljs-bullet">-3.0</span> 
<span class="hljs-bullet">            -</span>streaming.rest <span class="hljs-literal">true</span> 
<span class="hljs-bullet">            -</span>streaming.thrift <span class="hljs-literal">false</span> 
<span class="hljs-bullet">            -</span>streaming.platform spark 
<span class="hljs-bullet">            -</span>streaming.enableHiveSupport <span class="hljs-literal">true</span> 
<span class="hljs-bullet">            -</span>streaming.spark.service <span class="hljs-literal">true</span> 
<span class="hljs-bullet">            -</span>streaming.job.cancel <span class="hljs-literal">true</span> 
<span class="hljs-bullet">            -</span>streaming.datalake.path /data/mlsql/datalake 
<span class="hljs-bullet">            -</span>streaming.driver.port <span class="hljs-number">9003</span><span class="hljs-string">&quot; | bash
        command:
          - /bin/sh
          - &apos;-c&apos;
</span></code></pre>
<h3 id="&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-podip">&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-POD_IP</h3>
<p>spark.driver.host &#x9700;&#x8981;&#x914D;&#x7F6E;&#x6210; $POD_IP,&#x5177;&#x4F53;&#x65B9;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">        env:</span>
<span class="hljs-attr">          - name:</span> POD_IP
<span class="hljs-attr">            valueFrom:</span>
<span class="hljs-attr">              fieldRef:</span>
<span class="hljs-attr">                fieldPath:</span> status.podIP
<span class="hljs-attr">          - name:</span> NODE_IP
<span class="hljs-attr">            valueFrom:</span>
<span class="hljs-attr">              fieldRef:</span>
<span class="hljs-attr">                fieldPath:</span> status.hostIP
</code></pre>
<h3 id="&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-serviceaccountname">&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-serviceAccountName</h3>
<p>&#x901A;&#x5E38;&#x5728;K8s&#x91CC;&#x9700;&#x8981;&#x914D;&#x7F6E;<code>--conf spark.kubernetes.authenticate.driver.serviceAccountName=xxxx</code>, &#x76EE;&#x7684;&#x662F;&#x4E3A;&#x4E86;&#x8FC7;K8s&#x76F8;&#x5173;&#x7684;&#x6743;&#x9650;&#x3002;</p>
<h3 id="&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-java&#x53C2;&#x6570;&#x914D;&#x7F6E;">&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x914D;&#x7F6E;&#x70B9;-Java&#x53C2;&#x6570;&#x914D;&#x7F6E;</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x4F7F;&#x7528;JDK8&#x7684;&#x955C;&#x50CF;&#xFF0C;&#x90A3;&#x4E48;&#x9700;&#x8981;&#x79FB;&#x9664;<code>spark.executor.extraJavaOptions</code>,<code>spark.driver.extraJavaOptions</code>&#x7B49;&#x4E24;&#x4E2A;&#x914D;&#x7F6E;&#x9009;&#x9879;&#x3002;&#x4ED6;&#x4EEC;&#x662F;&#x4E3A;JDK14&#x51C6;&#x5907;&#x7684;&#x3002;</p>
<h3 id="&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x914D;&#x7F6E;&#x4E2D;&#x7684;&#x955C;&#x50CF;">&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x914D;&#x7F6E;&#x4E2D;&#x7684;&#x955C;&#x50CF;</h3>
<p>&#x5176;&#x4E2D;&#xFF0C;&#x4E0A;&#x9762;&#x8BBE;&#x8BA1;&#x7684;&#x955C;&#x50CF;xxxxx/dev/spark-jdk-slim-14:v3.0.0&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5B98;&#x65B9;&#x63D0;&#x4F9B;&#x7684;&#x955C;&#x50CF;&#x5DE5;&#x5177;&#x6765;&#x83B7;&#x5F97;&#x3002;&#x5177;&#x4F53;&#x65B9;&#x5F0F;&#x5982;&#x4E0B;(&#x4EE5;Spark2.4.3&#x7248;&#x672C;&#x4E3A;&#x4F8B;)&#xFF1A;</p>
<pre><code class="lang-shell"> cd $SPARK_HOME &amp;&amp; 
     ./bin/docker-image-tool.sh -t v2.4.3 build
</code></pre>
<p>&#x4E0A;&#x9762;&#x6267;&#x884C;&#x5B8C;&#x4F1A;&#x6253;&#x4E09;&#x4E2A;images&#xFF1A;spark:v2.4.3 / spark-py:v2.4.3 / spark-r:v2.4.3</p>
<p>&#x4F60;&#x5982;&#x679C;&#x53EA;&#x9700;&#x8981;spark&#x57FA;&#x672C;&#x955C;&#x50CF;&#x5305;&#x53EF;&#x6267;&#x884C;&#xFF1A;</p>
<pre><code class="lang-shell">     cd $SPARK_HOME &amp;&amp;
     docker build -t spark:latest -f kubernetes/dockerfiles/spark/Dockerfile .
</code></pre>
<h3 id="mlsql-engine-jar&#x5305;&#x5982;&#x4F55;&#x653E;&#x5230;&#x955C;&#x50CF;&#x91CC;">MLSQL Engine Jar&#x5305;&#x5982;&#x4F55;&#x653E;&#x5230;&#x955C;&#x50CF;&#x91CC;</h3>
<p>&#x53EF;&#x4EE5;&#x628A;MLSQL Engine Jar&#x5305;&#x4F7F;&#x7528;K8s&#x7684;Volume&#x529F;&#x80FD;&#x6302;&#x8F7D;&#x5230;pod&#x91CC;&#x53BB;&#x3002;&#x540C;&#x7406;--jars &#x76EE;&#x5F55;&#x3002;Executor&#x7684;Pod&#x4E0D;&#x9700;&#x8981;&#x6302;&#x8F7D;&#x3002;</p>
<h3 id="hadoop&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x5982;&#x4F55;&#x653E;&#x5230;&#x955C;&#x50CF;&#x91CC;">Hadoop&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x5982;&#x4F55;&#x653E;&#x5230;&#x955C;&#x50CF;&#x91CC;</h3>
<p>&#x540C;&#x6837;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;K8s Volumn&#x8FDB;&#x884C;&#x6302;&#x8F7D;&#xFF0C;&#x7136;&#x540E;&#x8BBE;&#x7F6E;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x3002;&#x4E5F;&#x53EF;&#x4EE5;&#x5C06;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x653E;&#x5230;SPARK_HOME/conf&#x91CC;&#x4E4B;&#x540E;&#x518D;&#x6267;&#x884C;&#x955C;&#x50CF;&#x6784;&#x5EFA;&#x547D;&#x4EE4;&#x3002;</p>
<h3 id="spark-30&#x7248;&#x672C;&#x5982;&#x4F55;&#x517C;&#x5BB9;hive-12">Spark 3.0&#x7248;&#x672C;&#x5982;&#x4F55;&#x517C;&#x5BB9;hive 1.2</h3>
<p>Spark3.0&#x9ED8;&#x8BA4;&#x4E0D;&#x517C;&#x5BB9; hive 1.2 &#x9700;&#x8981;&#x81EA;&#x5DF1;&#x4ECE;Spark&#x6E90;&#x7801;&#x91CD;&#x65B0;&#x6253;&#x5305;&#x3002;&#x8B6C;&#x5982;&#x4E0B;&#x9762;&#x7684;&#x7F16;&#x8BD1;&#x53C2;&#x6570;&#x5C31;&#x6307;&#x5B9A;&#x4E86;hive-1.2&#x7684;&#x652F;&#x6301;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x53D1;&#x578B;&#x5305;&#x6784;&#x5EFA;&#x955C;&#x50CF;&#x3002;</p>
<pre><code>git checkout -b v3.0.0 v3.0.0
./dev/make-distribution.sh \
--name hadoop2.7 \
--tgz \
-Pyarn -Phadoop-2.7 -Phive-1.2 -Phive-thriftserver -Pkubernetes \
-DskipTests
</code></pre><h3 id="lzosnappy&#x7684;&#x95EE;&#x9898;">LZO/Snappy&#x7684;&#x95EE;&#x9898;</h3>
<p>LZO&#x7684;jar&#x5305;&#x76F4;&#x63A5;&#x4E22;SPARK_HOME/jars&#x91CC;&#x5373;&#x53EF;&#x3002;</p>
<p>Snappy&#x9700;&#x8981;&#x901A;&#x8FC7;--conf java&#x53C2;&#x6570;&#x6307;&#x5B9A;&#xFF1A;</p>
<pre><code>--conf spark.executor.extraJavaOptions=-Djava.library.path=/opt/.../lib/native/
</code></pre><p>&#x8BF7;&#x786E;&#x4FDD;&#x6240;&#x6709;&#x7684;&#x955C;&#x50CF;&#x91CC;&#x90FD;&#x6709;&#x914D;&#x7F6E;&#x7684;&#x8DEF;&#x5F84;&#x3002;</p>
<h2 id="&#x5982;&#x4F55;&#x914D;&#x7F6E;service&#x5B9E;&#x73B0;&#x5916;&#x90E8;&#x8BBF;&#x95EE;">&#x5982;&#x4F55;&#x914D;&#x7F6E;Service&#x5B9E;&#x73B0;&#x5916;&#x90E8;&#x8BBF;&#x95EE;</h2>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x914D;&#x7F6E;service/ingress&#x6765;&#x5B9E;&#x73B0;&#x5916;&#x90E8;&#x8BBF;&#x95EE;Engine.</p>
<p>&#x9996;&#x5148;&#x662F;service.yaml&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> v1
<span class="hljs-attr">kind:</span> Service
<span class="hljs-attr">metadata:</span>
<span class="hljs-attr">  annotations:</span> {}
<span class="hljs-attr">  name:</span> spark-mlsql
<span class="hljs-attr">  namespace:</span> dev
<span class="hljs-attr">spec:</span>
<span class="hljs-attr">  ports:</span>
<span class="hljs-attr">    - name:</span> mlsql
<span class="hljs-attr">      port:</span> <span class="hljs-number">9003</span>
<span class="hljs-attr">      targetPort:</span> <span class="hljs-number">9003</span>
<span class="hljs-attr">    - name:</span> spark
<span class="hljs-attr">      port:</span> <span class="hljs-number">4040</span>
<span class="hljs-attr">      targetPort:</span> <span class="hljs-number">4040</span>
<span class="hljs-attr">  selector:</span>
<span class="hljs-attr">    app:</span> spark-mlsql<span class="hljs-bullet">-3</span>
</code></pre>
<p>&#x63A5;&#x7740;ingress.yaml&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> extensions/v1beta1
<span class="hljs-attr">kind:</span> Ingress
<span class="hljs-attr">metadata:</span>
<span class="hljs-attr">  name:</span> spark-mlsql-ingress
<span class="hljs-attr">  namespace:</span> dev
<span class="hljs-attr">spec:</span>
<span class="hljs-attr">  rules:</span>
<span class="hljs-attr">    - host:</span> xxxxxxxxx
<span class="hljs-attr">      http:</span>
<span class="hljs-attr">        paths:</span>
<span class="hljs-attr">        - path:</span> /
<span class="hljs-attr">          backend:</span>
<span class="hljs-attr">            serviceName:</span> spark-mlsql 
<span class="hljs-attr">            servicePort:</span> <span class="hljs-number">9003</span>
<span class="hljs-attr">    - host:</span> xxxxxxxx
<span class="hljs-attr">      http:</span>
<span class="hljs-attr">        paths:</span>
<span class="hljs-attr">        - path:</span> /
<span class="hljs-attr">          backend:</span>
<span class="hljs-attr">            serviceName:</span> spark-mlsql
<span class="hljs-attr">            servicePort:</span> <span class="hljs-number">4040</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="deploy.html" class="navigation navigation-prev " aria-label="Previous page: Local">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="yarn_deploy.html" class="navigation navigation-next " aria-label="Next page: Yarn部署">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"K8s部署","level":"1.2.3","depth":2,"next":{"title":"Yarn部署","level":"1.2.4","depth":2,"path":"howtouse/yarn_deploy.md","ref":"howtouse/yarn_deploy.md","articles":[]},"previous":{"title":"Local","level":"1.2.2","depth":2,"path":"howtouse/deploy.md","ref":"howtouse/deploy.md","articles":[]},"dir":"ltr"},"config":{"plugins":["image-class","lightbox"],"styles":{"website":"styles/image.css"},"pluginsConfig":{"image-class":{},"lightbox":{"jquery":true,"sameUuid":false},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"MLSQL Engine 文档","gitbook":"*","description":"MLSQL Engine 官方文档"},"file":{"path":"howtouse/k8s_deploy.md","mtime":"2020-08-31T10:51:02.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-09-03T03:59:44.434Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

